#! /bin/bash
set -e

CHECK_PARAM=$1

do_something() {
    if [ "${CHECK_PARAM}" == "5" ]; then
        echo "The argument is 5"
    else
        echo "The argument is not 5"
        exit 1
    fi
}


main() {
    do_something $CHECK_PARAM
    # 下面这个是一种错误处理方法，但是上面的函数已经有 exit 1，感觉也没有必要
    do_something ${CHECK_PARAM} >&2 || exit 1
    echo "The script is done"
}

main